<template>
  <div>
    <T_Form
      ref="ruleFormRef"
      :model="ruleForm"
      :form-items="FormItems"
      :rules="rules"
      class="demo-ruleForm"
    ></T_Form>
    <el-button type="primary" @click="submitForm">Submit</el-button>
  </div>
</template>
<script lang="ts" setup name="FormIndex">
import { FormItems } from './FormTem'
import { RuleClass } from '@/utils/element'
import type { FormInstance } from 'element-plus'
const ruleFormRef = ref<FormInstance>()
const ruleForm = reactive({
  pass: '',
  checkPass: '',
  age: '',
  list: ''
})

const rules = new RuleClass(['pass', 'checkPass', 'age'])
const submitForm = () => {
  console.log(ruleForm, 'ruleForm')
}
</script>
<style lang="scss" scoped></style>
